//
//  YSY_HeroDetail_View.m
//  GoodManNews
//
//  Created by dllo on 16/1/12.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "YSY_HeroDetail_View.h"
#import "Masonry.h"
@implementation YSY_HeroDetail_View
- (void)dealloc
{
    [_headImage release];
    [_nameL release];
    [_priceL release];
    [_locationL release];
    [_baseL release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    self.headImage = [UIImageView new];
//    self.headImage.backgroundColor = [UIColor blueColor];
    [self addSubview:self.headImage];
    [self.headImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).with.offset(10);
        make.left.equalTo(self).with.offset(10);
//        make.right.equalTo(self.nameL.mas_left).with.offset(-10);
        make.width.mas_equalTo([UIScreen mainScreen].bounds.size.width/ 3);
        make.height.mas_equalTo([UIScreen mainScreen].bounds.size.height / 6);
    }];
    //名字
    self.nameL = [UILabel new];
    self.nameL.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];
//    self.nameL.backgroundColor = [UIColor yellowColor];
    [self addSubview:self.nameL];
    [self.nameL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).with.offset(10);
        make.left.equalTo(self.headImage.mas_right).with.offset(10);
        make.right.equalTo(self).with.offset(-10);
//        make.height.mas_equalTo(@[self.priceL, self.locationL, self.baseL]);
        make.height.mas_equalTo([UIScreen mainScreen].bounds.size.height / 24);
    }];
    
//    //价钱
    self.priceL = [UILabel new];
//    self.priceL.backgroundColor = [UIColor redColor];
    [self addSubview:self.priceL];
    [self.priceL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.nameL.mas_bottom);
        make.left.equalTo(self.headImage.mas_right).with.offset(10);
        make.right.equalTo(self).with.offset(-10);
//        make.height.mas_equalTo(@[self.nameL, self.locationL, self.baseL]);
        make.height.mas_equalTo([UIScreen mainScreen].bounds.size.height / 24);
        
    }];
//    //位置
    self.locationL = [UILabel new];
//    self.locationL.backgroundColor = [UIColor yellowColor];
    [self addSubview:self.locationL];
    [self.locationL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.priceL.mas_bottom);
        make.left.equalTo(self.headImage.mas_right).with.offset(10);
        make.right.equalTo(self).with.offset(-10);
//        make.height.mas_equalTo(@[self.nameL, self.priceL, self.baseL]);
        make.height.mas_equalTo([UIScreen mainScreen].bounds.size.height / 24);
        
    }];
//    //系数
    self.baseL = [UILabel new];
//    self.baseL.backgroundColor = [UIColor redColor];
    [self addSubview:self.baseL];
    [self.baseL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.locationL.mas_bottom);
        make.left.equalTo(self.headImage.mas_right).with.offset(10);
        make.right.equalTo(self).with.offset(-10);
//        make.height.mas_equalTo(@[self.nameL, self.priceL, self.locationL]);
//        make.bottom.equalTo(self.headImage);
        make.height.mas_equalTo([UIScreen mainScreen].bounds.size.height / 24);
    }];
    
    
}

@end
